<?PHP

	class tpl_managegroups {
		
		public static function managegroups(){
		
			$class = 'td1';
			$group_html = '';
			foreach($GLOBALS['OUTPUT']->groups as $gname=>$gid){
				$class = ($class == 'td1' ? 'td2' : 'td1');
				
				$group_html .= <<<EOV
<tr>
	<td class='$class'>{$gname}</td>
	<td class='$class'><a href='./index.php?act=admin&page=editgroup&gid={$gid}{$GLOBALS['OUTPUT']->ses}'>[{$GLOBALS['LANG']->lang_admin->edit}]</a> <a href='./index.php?act=admin&page=editgroup&section=groupmembers&gid={$gid}{$GLOBALS['OUTPUT']->ses}'>[{$GLOBALS['LANG']->lang_admin->members}]</a> <a href='./index.php?act=admin&page=editgroup&section=grouppermissions{$GLOBALS['OUTPUT']->ses}&gid={$gid}'>[{$GLOBALS['LANG']->lang_admin->permissions}]</a> <a href='./index.php?act=admin&page=managegroups&del={$gid}{$GLOBALS['OUTPUT']->ses}'>[{$GLOBALS['LANG']->lang_admin->delete}]</a></td>
</tr>
EOV;
			}
			
			return	tpl_globals::header() .
				<<<EOV
<div class='table_header'>&nbsp;{$GLOBALS['LANG']->lang_admin->managegroups}</div>
	<table style='width: 100%;' cellspacing='1' cellpadding='5'>
		<tr>
			<td class='table_header_row' width='60%'>{$GLOBALS['LANG']->lang_admin->groupname}</td>
			<td class='table_header_row' width='40%'>{$GLOBALS['LANG']->lang_admin->action}</td>
		</tr>
		{$group_html}
	</table>
	
	<br />
	
	<form action='./index.php?act=admin{$GLOBALS['OUTPUT']->ses}&page=managegroups' method='post'>
	
	<div class='table_header'>&nbsp;{$GLOBALS['LANG']->lang_admin->addgroup}</div>
	<table style='width: 100%;' cellspacing='1' cellpadding='5'>
		<tr>
			<td class='td2' width='50%'>
				{$GLOBALS['LANG']->lang_admin->groupname}
			</td>
			<td class='td2'>
EOV
.
				tpl_form::text_password_file('text','groupname') .
				<<<EOV
			</td>
		</tr>
		<tr>
			<td class='td2' width='50%'>
				{$GLOBALS['LANG']->lang_admin->groupimage}<br />
				<div class='instructions'>{$GLOBALS['LANG']->lang_admin->groupimagedesc}</div>
			</td>
			<td class='td2'>
EOV
.
				tpl_form::text_password_file('text','groupimage') .
				<<<EOV
			</td>
		</tr>
		<tr>
			<td class='table_header_row' colspan='2'><input class='form_button_norm' onmouseout="this.className=this.className.replace('_over','_norm');" onmouseover="this.className=this.className.replace('_norm','_over');" type='submit' value='{$GLOBALS['LANG']->lang_formcommon->submit}' /></td>
		</tr>
	</table>
	
	</form>
EOV
.
			tpl_globals::footer();
				
		}
		
	}

?>